1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to intraprediction encoding/decoding, and more particularly, to intrapredicting a current block and then encoding and decoding the current block based on the intraprediction result.
2. Description of the Related Art
In video compression standards such as moving picture expert group (MPEG)-1, MPEG-2, and H.264/MPEG-4 advanced video coding (AVC), a picture is divided into macroblocks for video encoding. Each of the macroblocks is then encoded using interprediction and intraprediction. Next, an optimal encoding mode is selected based on the size of data of the encoded macroblock and the degree of distortion between the encoded macroblock and the original macroblock. The macroblock is encoded in the selected encoding mode.
In intraprediction, instead of referring to reference pictures, the current block is encoded using a pixel that is spatially adjacent to the current block to be encoded. First, a prediction block for the current block to be encoded is generated using a pixel value of a pixel that is adjacent to the current block. Only the difference between pixel values of the generated prediction block and pixel values of the current block is encoded. Intraprediction modes are roughly divided into 4×4 intraprediction modes for luminance components, 8×8 intraprediction modes, 16×16 intraprediction modes, and an intraprediction mode for chrominance components.
FIG. 1 illustrates 16×16 intraprediction modes according to the related art.
Referring to FIG. 1, there are four 16×16 intraprediction modes, i.e. a vertical mode, a horizontal mode, a direct current (DC) mode, and a plane mode.
FIG. 2 illustrates 4×4 intraprediction modes according to the prior art.
Referring to FIG. 2, there are nine 4×4 intraprediction modes, i.e. a vertical mode, a horizontal mode, a DC mode, a diagonal down-left mode, a diagonal down-right mode, a vertical right mode, a vertical left mode, a horizontal up mode, and a horizontal down mode.
Prediction mode numbers indexed to intraprediction modes are determined according to the frequency with which the intraprediction modes are used. In other words, the vertical mode indexed by 0 is most frequently used in intraprediction, and the horizontal up mode is least frequently used in intraprediction.
For example, when a 4×4 current block is prediction encoded in a mode 0, i.e. the vertical mode of FIG. 2, pixels of the 4×4 current block are predicted using pixel values of pixels A through D immediately above the 4×4 current block. In other words, the pixel value of the pixel A is predicted to be the pixel values of the four pixels of the first column of the 4×4 current block, the pixel value of the pixel B is predicted to be the pixel values of the four pixels of the second column of the 4×4 current block, the pixel value of the pixel C is predicted to be the pixel values of the four pixels of the third column of the 4×4 current block, and the pixel value of the pixel D is predicted to be the pixel values of the four pixels of the fourth column of the 4×4 current block. Next, a prediction block for the current block predicted using the pixels A through D is subtracted from the original current block, thereby generating a residual block. The residual block is encoded and inserted into a bitstream.
In video encoding according to the H.264 standard, the current macroblock is encoded in a total of 13 modes, including the 4×4 intraprediction modes and the 16×16 intraprediction modes, and a bitstream for the current block is generated in the optimal one of the 13 modes.
In intraprediction according to the related art, as illustrated in FIGS. 1 and 2, the current block is predicted using pixels that are adjacent to the current block, i.e., that are located in at least one of a position to the left of, a position above, and a position above and to the left of the current block.
However, when pixels included in the current block have no directivity as illustrated in FIGS. 1 and 2, an inaccurate prediction block is generated by intraprediction illustrated in FIGS. 1 and 2, thereby degrading the efficiency of video compression.